The _gggg_eeee_tttt_ssss_pppp_eeee_nnnn_tttt routine when first called returns a pointer to the first
_ssss_pppp_wwww_dddd structure in the file; thereafter, it returns a pointer to the next
_ssss_pppp_wwww_dddd structure in the file; so successive calls can be used to search the
entire file. The _gggg_eeee_tttt_ssss_pppp_nnnn_aaaa_mmmm routine searches from the beginning of the
file until a login name matching _n_a_m_e is found, and returns a pointer to
the particular structure in which it was found. The _gggg_eeee_tttt_ssss_pppp_eeee_nnnn_tttt and
_gggg_eeee_tttt_ssss_pppp_nnnn_aaaa_mmmm routines populate the _ssss_pppp______mmmm_iiii_nnnn, _ssss_pppp______mmmm_aaaa_xxxx, _ssss_pppp______llll_ssss_tttt_cccc_hhhh_gggg, _ssss_pppp______wwww_aaaa_rrrr_nnnn,
_ssss_pppp______iiii_nnnn_aaaa_cccc_tttt, _ssss_pppp______eeee_xxxx_pppp_iiii_rrrr_eeee, or _ssss_pppp______ffff_llll_aaaa_gggg field with -1 if the corresponding field
in _////_eeee_tttt_cccc_////_ssss_hhhh_aaaa_dddd_oooo_wwww is empty. If an end-of-file or an error is encountered on
reading, or there is a format error in the file, these functions return a
null pointer and set _eeee_rrrr_rrrr_nnnn_oooo to _EEEE_IIII_NNNN_VVVV_AAAA_LLLL.
_////_eeee_tttt_cccc_////_...._pppp_wwww_dddd_...._llll_oooo_cccc_kkkk is the lock file. It is used to coordinate modification
access to the password files _////_eeee_tttt_cccc_////_pppp_aaaa_ssss_ssss_wwww_dddd and _////_eeee_tttt_cccc_////_ssss_hhhh_aaaa_dddd_oooo_wwww. _llll_cccc_kkkk_pppp_wwww_dddd_ffff and
_uuuu_llll_cccc_kkkk_pppp_wwww_dddd_ffff are routines that are used to gain modification access to the
password files, through the lock file. A process first uses _llll_cccc_kkkk_pppp_wwww_dddd_ffff to
lock the lock file, thereby gaining exclusive rights to modify the
_////_eeee_tttt_cccc_////_pppp_aaaa_ssss_ssss_wwww_dddd or _////_eeee_tttt_cccc_////_ssss_hhhh_aaaa_dddd_oooo_wwww password file. Upon completing modifications,
a process should release the lock on the lock file via _uuuu_llll_cccc_kkkk_pppp_wwww_dddd_ffff. This
mechanism prevents simultaneous modification of the password files.
_llll_cccc_kkkk_pppp_wwww_dddd_ffff attempts to lock the file _////_eeee_tttt_cccc_////_...._pppp_wwww_dddd_...._llll_oooo_cccc_kkkk within 15 seconds. If
unsuccessful, e.g., _////_eeee_tttt_cccc_////_...._pppp_wwww_dddd_...._llll_oooo_cccc_kkkk is already locked, it returns -1. If
successful, a return code other than -1 is returned.
_uuuu_llll_cccc_kkkk_pppp_wwww_dddd_ffff attempts to unlock the file _////_eeee_tttt_cccc_////_...._pppp_wwww_dddd_...._llll_oooo_cccc_kkkk. If unsuccessful,
e.g., _////_eeee_tttt_cccc_////_...._pppp_wwww_dddd_...._llll_oooo_cccc_kkkk is already unlocked, it returns -1. If successful,
it returns 0.
A call to the _ssss_eeee_tttt_ssss_pppp_eeee_nnnn_tttt routine has the effect of rewinding the shadow
password file to allow repeated searches. The _eeee_nnnn_dddd_ssss_pppp_eeee_nnnn_tttt routine may be
called to close the shadow password file when processing is complete.
The _ffff_gggg_eeee_tttt_ssss_pppp_eeee_nnnn_tttt routine returns a pointer to the next _ssss_pppp_wwww_dddd structure in the
stream _f_p, which matches the format of _////_eeee_tttt_cccc_////_ssss_hhhh_aaaa_dddd_oooo_wwww.
Many SVR4 derived programs use these routines exclusively to get password
and aging information. These programs assume that all systems have a
_////_eeee_tttt_cccc_////_ssss_hhhh_aaaa_dddd_oooo_wwww file. Historically, IRIX has not had a _////_eeee_tttt_cccc_////_ssss_hhhh_aaaa_dddd_oooo_wwww file so
in order to permit these standard SVR4 programs to work properly,
_gggg_eeee_tttt_ssss_pppp_nnnn_aaaa_mmmm, in the absence of a shadow file, will get as much information
as possible from _////_eeee_tttt_cccc_////_pppp_aaaa_ssss_ssss_wwww_dddd. _gggg_eeee_tttt_ssss_pppp_eeee_nnnn_tttt does not have this compatibility
feature, and will return NULL if the system has no _////_eeee_tttt_cccc_////_ssss_hhhh_aaaa_dddd_oooo_wwww file.
The routines getspent, fgetspent and getspnam return results in a
statically allocated memory location which is overwritten on each call.
Reentrant versions of each of these routines getspent_r, fgetspent_r and
getspnam_r which will parse the results into supplied memory. Each takes
three extra parameters, a pointer to a shadow password structure, a
pointer to a character buffer, and a length for the buffer.
_gggg_eeee_tttt_ssss_pppp_eeee_nnnn_tttt, _gggg_eeee_tttt_ssss_pppp_nnnn_aaaa_mmmm, and _ffff_gggg_eeee_tttt_ssss_pppp_eeee_nnnn_tttt return a null pointer on _EEEE_OOOO_FFFF or error.
_llll_cccc_kkkk_pppp_wwww_dddd_ffff and _uuuu_llll_cccc_kkkk_pppp_wwww_dddd_ffff return -1 on error.